package fr.upmc.i3s.fuglmeyeranalyser.patients;

import java.util.LinkedList;

import fr.upmc.i3s.fuglmeyeranalyser.tools.xls.XLSConstants;

public class PrivatePatient {
	
	private LinkedList<PatientParameter> paramsList;
	
	public PrivatePatient() {
		this.paramsList = new LinkedList<PatientParameter>();
	}
	
	public String getId() {
		for(PatientParameter pp : paramsList) {
			if(pp.getName().equals(XLSConstants.XLS_ID_PATIENT)) {
				return pp.getValue();
			}
		}
		return null;
	}
	
	public LinkedList<PatientParameter> getParamsList() {
		return paramsList;
	}

	public void addParam(String name, String value) {
		this.paramsList.add(new PatientParameter(name, value));
	}
	
	@Override
	public String toString() {
		return "Patient [id=" + getId() + ", paramsList=" + paramsList + "]";
	}

	public String toUserString() {
		String result = "Patient "+getId()+" :\n";
		for(PatientParameter pp : paramsList) {
			result+="["+pp.getName()+", "+pp.getValue()+"]\n";
		}
		return result;
	}
}
